<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<style>
    .form-horizontal .row{
        margin: 0 55px 0 55px;
    }
</style>
<div class="main-content">
    <div class="box box-main">
        <form id="inputForm" model="post" action="<c:url value="/web/admin/systemUser/updateSystemUserPassward.action"/>"
              method="post" class="form-horizontal">
            <div class="box-body">
                <input id="userId" name="id" value="${systemUser.id}" type="hidden">
                <div class="row">
                    <div class="form-group has-feedback clearfix">
                        <strong>设置旧密码：</strong>
                    </div>
                    <div class="form-group has-feedback">
                        <span class="fa fa-lock form-control-feedback"></span>
                        <input type="text" autocomplete="off" id="old_password" name="old_password"
                               class="form-control required" data-msg-required="请填写旧密码."
                               rangelength="3,50" data-msg-rangelength="新密码长度不能小于3并大于50个字符."
                               placeholder="旧密码" />
                    </div>
                    <div class="form-group has-feedback clearfix">
                        <strong>设置新密码：</strong>
                    </div>
                    <div class="form-group has-feedback">
                        <span class="fa fa-lock form-control-feedback"></span>
                        <input type="password" autocomplete="off" id="fp_password" name="password"
                               class="form-control required" data-msg-required="请填写新密码."
                               rangelength="3,50" data-msg-rangelength="新密码长度不能小于3并大于50个字符."
                               placeholder="新密码" />
                    </div>
                    <div class="form-group has-feedback">
                        <span class="fa fa-lock form-control-feedback"></span>
                        <input type="password" autocomplete="off" id="fp_confirmPassword" name="confirmPassword"
                               class="form-control required" data-msg-required="请填写确认新密码."
                               rangelength="3,50" data-msg-rangelength="新密码长度不能小于3并大于50个字符."
                               equalTo="#fp_password" data-msg-equalTo="新密码与确认新密码不同."
                               placeholder="确认新密码" />
                    </div>
                </div>
            </div>

            <div class="box-footer">
                <div class="row">
                    <div class="col-sm-offset-2 col-sm-10">
                        <button type="submit" class="btn btn-sm btn-primary" id="btnSubmit"><i class="fa fa-check"></i>
                            保 存
                        </button>&nbsp;

                        <button type="button" class="btn btn-sm btn-default" id="btnCancel" onclick="closeView()"><i
                                class="fa fa-times"></i> 关 闭
                        </button>
                    </div>
                </div>
            </div>
        </form>
    </div>
</div>
<script>
    $("#inputForm").validate({
        submitHandler: function (form) {
            js.ajaxSubmitForm($(form), function (data) {
                js.showMessage(data.msg);
                if (data.status == Global.NO) {
                    closeView();
                }
            }, "json");
        }
    });

    function closeView() {
        layer.close(LayWin['wUpdatePassward']);
    }
</script>


